package com.bootdo.system.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.bootdo.system.dao.ProjectDao;
import com.bootdo.system.domain.ProjectDO;
import com.bootdo.system.service.ProjectService;



@Service
public class ProjectServiceImpl implements ProjectService {
	@Autowired
	private ProjectDao projectDao;
	
	@Override
	public ProjectDO get(Integer projectId){
		return projectDao.get(projectId);
	}
	
	@Override
	public List<ProjectDO> list(Map<String, Object> map){
		map.put("sort","project_id");
		return projectDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return projectDao.count(map);
	}
	
	@Override
	public int save(ProjectDO project){
		java.sql.Date date = new java.sql.Date(new Date().getTime());
		project.setStartDate(date);



		return projectDao.save(project);
	}
	
	@Override
	public int update(ProjectDO project){
		return projectDao.update(project);
	}
	
	@Override
	public int remove(Integer projectId){
		return projectDao.remove(projectId);
	}
	
	@Override
	public int batchRemove(Integer[] projectIds){
		return projectDao.batchRemove(projectIds);
	}

	@Override
	public List<ProjectDO> listall() {
		return projectDao.listall();
	}

	@Override
	public List<ProjectDO> listforchoose(Long userId) {
		return projectDao.listforchoose(userId);
	}

	@Override
	public List<ProjectDO> getProjectByUserId(Long userId) {
		return projectDao.getProjectByUserId(userId);
	}

}
